package com.etpjava.dao;

import java.util.Date;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.etpjava.model.InviteJob;

public class Test {

	/**
	 * @param args
	 */
	
	public static Session getSession() {
		Configuration cfg = new Configuration();
		SessionFactory sessionFactory = cfg.configure().buildSessionFactory();
		return sessionFactory.openSession();
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
	   Session session=getSession();
	   session.beginTransaction();
		InviteJob invite=new InviteJob();
		invite.setBirthday(new Date());
		invite.setAge(23);

		invite.setTelphone("123");
		session.save(invite);
		session.getTransaction().commit();
		session.close();
		
	}

}
